<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="${ctxStatic}/layui/css/layui.css">
<link type="text/css" rel="stylesheet" href="${ctxStatic}/css/mainstyle.css"/>
<title>游乐网——幻之大地</title>
<script language="javascript">

	var northwest = null;
	var north = null;
	var northeast = null;
	var west = null;
	var east = null;
	var southwest = null;
	var south = null;
	var southeast = null;
	var cur = null;
	function moveto(obj) {
		var url = "${pageContext.request.contextPath}/fantasy/move/moveTo.do?fromid=" + cur + "&targetid=" + eval(obj.id);
		contentframe.window.location = url;
	}
	//只刷新frame页面
	var check=function(e){ 
		e=e||window.event; 
		//alert(e.which||e.keyCode); 
		if((e.which||e.keyCode)==116){ 
			if(e.preventDefault){ 
				e.preventDefault(); 
				window.frames["contentframe"].location.reload(); 
			} else{
				event.keyCode = 0; 
				e.returnValue=false; 
				window.frames["contentframe"].location.reload(); 
			} 
		} 
	}
	if(document.addEventListener){ 
		document.addEventListener("keydown",check,false); 
	} else{ 
		document.attachEvent("onkeydown",check); 
	}

	function gt() {
		var d = new Date();
		return(""+d.getYear()+d.getMonth()+d.getDay()+d.getHours()+d.getMinutes()+d.getSeconds()+d.getUTCMilliseconds());
	}
	var wh;
	function w(u,n,w,h,scrl){
		if (u.indexOf("?",0) == -1)
			u = u + "?time=";
		else
			u = u + "&time=";
		u = u + gt();
		wh = open(u,n,"width=" + w + ",height=" + h + ",stats=no,titlebar=no,location=no,toolbar=no,scrollbars=" + scrl + ",resizeable=no");
		wh.focus();
	}

	function savequit(){
		alert("让我们一起为了美好明天而奋斗！mapid=" + cur); //这里可以先要执行的判断语句，接着再执行window.close
		location.href = "${ctxf}/fantasy/user/logout.do?mapid=" + cur;
	}
</script>
</head>
<body>
<div class="container">
 	<!-- 头部 -->
  	<div class="layui-row">
	    <div class="navlogo">
			<img src="${ctxStatic}/images/f/豪华官邸_01.jpg" border="0">
	    </div>
	    <div class="navgb">
			<div class="layui-row fantasy-tips">
				<script type="text/javascript" src="${ctxStatic}/js/kouhao.js"></script>
			</div>
		    <!-- 头部区域（可配合layui已有的水平导航） -->
		    <ul class="nav">
		      <li class="layui-nav-item"><a href="">电子公告牌</a></li>
		      <li class="layui-nav-item"><a href="">世界地图</a></li>
		      <li class="layui-nav-item"><a href="">NPC定位</a></li>
		      <li class="layui-nav-item"><a href="">货物查询</a></li>
		      <li class="layui-nav-item"><a href="">玩家帮派</a></li>
		      <li class="layui-nav-item"><a href="">婚姻登记</a></li>
		      <li class="layui-nav-item"><a href="">新手指南</a></li>
		      <li class="layui-nav-item"><a href="">官方攻略</a></li>
		    </ul>
	    	<div class="triangle-left-bottom"></div>
	    </div>
  	</div>
  	<!-- 中部-->
  	<div class="layui-row">
		<div class="middleleft">
			<div id="userzone">
				<div id="userface">
					<img src="${ctxStatic}/images/fantasy/face.jpg" border="0">
				</div>
				<div id="compass">
					<div id="northwest" onclick="moveto(this);"></div>
					<div id="north" onclick="moveto(this);"></div>
					<div id="northeast" onclick="moveto(this);"></div>
					<div id="west" onclick="moveto(this);"></div>
					<div id="center" onclick="moveto(this);"></div>
					<div id="east" onclick="moveto(this);"></div>
					<div id="southwest" onclick="moveto(this);"></div>
					<div id="south" onclick="moveto(this);"></div>
					<div id="southeast" onclick="moveto(this);"></div>
				</div>
			</div>
			<div id="functions">
				<a href="javascript:w('openpacket.action?userid=${user.id }&mapid='+cur,'_blank',400,300,'yes')">
					<font>打开背包</font>
				</a>
				<a href="javascript:savequit();">
					<font>存盘退出</font>
				</a>
			</div>
			<div class="left2">
				<iframe name="main" width="100%" height="400" frameborder="0" scrolling="no"
						src="http://localhost:8081/chat?fromUser=${user.username}"></iframe>
			</div>
		</div>
	    <div class="middle">
			<div class="ads">
				<img src="${ctxStatic}/images/f/豪华官邸_03.jpg" border="0">
			</div>
			<div id="content">
				<iframe id="contentframe" name="contentframe"
				src="${pageContext.request.contextPath}/fantasy/move/moveTo.do?fromid=${fromid}&targetid=${targetid}"
				scrolling="no" frameborder="0" width="100%" height="100%" marginwidth="0" marginheight="0"></iframe>
			</div>
		    
	    </div>
	    <div class="middlebottom">
					
		</div>
  	</div>
	<!-- 底部 -->
	<div class="layui-row">
		<div class="layui-col-md3">
		
		</div>
		<div class="layui-col-md9">
		
		</div>
	</div>
  
</div>


</body>
</html>